package Text11;

import java.util.*;

public class Main {
    //有两个日期，求两个日期之间的天数，如果两个日期是连续的我们规定他们之间的天数为两天。
    static int y1, y2, m1, m2, d1, d2;
    static int[] moth = {0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int t1 = in.nextInt();
            int t2 = in.nextInt();
            y1 = t1 / 10000;
            m1 = t1 % 10000 / 100;
            d1 = t1 % 100;
            y2 = t2 / 10000;
            m2 = t2 % 10000 / 100;
            d2 = t2 % 100;
            System.out.println(Math.abs(get_total_days(y2, m2, d2) - get_total_days(y1, m1, d1)) + 1);
        }
    }

    private static int get_total_days(int y, int m, int d) {
        int res = 0;
        for (int i = 1; i < y; i++) {
            res += 365 + is_leap(i);
        }
        res += moth[m];
        if (m > 2) {
            res += is_leap(y);
        }
        return res + d;
    }

    private static int is_leap(int y) {
        if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {
            return 1;
        }
        return 0;
    }
}

